export default {
  namespaced: true,
  state: {
    title: "shop",
  },
  getters: {
    g1: () => "shop g1",
  },
  mutations: {
    SET_TITLE: (state, value) => (state.title = value),
  },
  actions: {
    add(store, { x, y }) {
      console.log(store.state.title, store.rootState, x + y);
    },
  },
  modules: {
    shopA: {
      namespaced: true,
      state: {
        title: "shopA",
      },
      getters: {
        g1: () => "shopA g1",
      },
      mutations: {
        SET_TITLE: (state, value) => (state.title = value),
      },
      actions: {
        add(store, { x, y }) {
          console.log(store.state.title, store.rootState, x + y);
        },
      },
    },
  },
};
